//
//  SolidMaterial.cpp
//  Ray Tracer
//
//  Created by Kaila, Ashish on 3/23/13.
//  Copyright (c) 2013 Kaila, Ashish. All rights reserved.
//

#include "SolidMaterial.h"

SolidMaterial::SolidMaterial(Colour ambient,
                             Colour diffuse,
                             Colour specular,
                             double specularExp,
                             double diffuseReflectivityFactor,
                             double specularReflectivityFactor,
                             double refractiveIndex)
: Material(specularExp, diffuseReflectivityFactor, specularReflectivityFactor, refractiveIndex),
  _ambient(ambient),
  _diffuse(diffuse),
  _specular(specular)
{

}

Colour SolidMaterial::getColour(ColourType type, const Intersection& intersection, bool inShadow) const
{
    switch (type) {
        case Ambient:
            return _ambient;
            break;
            
        case Diffuse:
            return _diffuse;
            break;
            
        case Specular:
            return _specular;
            break;
    }
    
    throw "Out of range";
}